package dao

import (
	"context"
	"gorm.io/gorm"
)

type User struct {
	ID     string `gorm:"primaryKey"`
	Passwd string `gorm:"colunm:passwd"`
}

type LoginDao interface {
	Creat(ctx context.Context, user User) error
}

type logindao struct {
	db *gorm.DB
}

func NewLogindao(db *gorm.DB) LoginDao {
	db.AutoMigrate(&User{})
	return &logindao{db: db}
}
func (l *logindao) Creat(ctx context.Context, user User) error {
	//TODO implement me
	l.db.Create(&user)
	panic("implement me")
}
